﻿using System;
using System.Collections.Generic;
using Common.ParameterLocator;
using SpecFlowTfsLinker.Entities;
using SpecFlowTfsLinker.Printer;

namespace SpecFlowTfsLinker.Tools
{
    [Serializable]
    public static class StatementTools
    {
        public static string TransformStatementToStatementWithParameter(Statement statement,
                                                                        List<ParameterPrinter> parameters)
        {
            var transformedStatment = statement.Value;

            parameters.ForEach(
                parameter =>
                    {
                        transformedStatment = transformedStatment.Replace(parameter.Parameter,
                                                                          ServiceParameter.Instance.Parameter.
                                                                              FormatParameter);
                    });
            return transformedStatment.Replace("\"", "");
        }

        public static string DeleteAllQuotes(Statement statement)
        {
            return statement.Value.Replace("\"", "");
        }
    }
}